<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>输出100以内的质数</title>
    <script>
        var flag = 1;
        for(var n = 2; n < 101; n ++){
            for(var i = 2; i < n; i ++){
                if(n % i == 0){
                    flag = 0;
                    break;
                }else{
                    flag = 1;
                }
            }
            if(flag == 1){
                document.write(n + ' ');
            }
        }
    </script>
</body>
</html>